Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function EncodeBytes( _ ByVal input() As Byte _ ) As String |
Parameters
- input
Library/Library.Test/TestHexEncoding.cs
C# | Copy Code |
---|---|
byte[] all = new byte[256]; for (int i = 0; i < all.Length; i++) all[i] = (byte)i; Assert.AreEqual(AllHex, HexEncoding.EncodeBytes(all)); Assert.AreEqual(0, BinaryComparer.Compare(all, HexEncoding.DecodeBytes(AllHex))); Assert.AreEqual(0, BinaryComparer.Compare(all, HexEncoding.DecodeBytes(AllHex.ToUpper()))); |
VB.NET | Copy Code |
---|---|
Dim all As Byte() = New Byte(256) {} Dim i As Integer = 0 While i < all.Length all(i) = DirectCast(i, Byte) System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) End While Assert.AreEqual(AllHex, HexEncoding.EncodeBytes(all)) Assert.AreEqual(0, BinaryComparer.Compare(all, HexEncoding.DecodeBytes(AllHex))) Assert.AreEqual(0, BinaryComparer.Compare(all, HexEncoding.DecodeBytes(AllHex.ToUpper()))) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
HexEncoding ClassHexEncoding Members
Overload List